package sk.octopuss.archery.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import sk.octopuss.archery.utils.RegexPatternConstraintValidator;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy=RegexPatternConstraintValidator.class)
public @interface RegexPattern {
	
	/**
	 * @return The regular expression message key to find.
	 */
	 String source();
	 	
	/**
	 * @return The error message template.
	 */
		String message() default "{sk.octopuss.archery.annotation.regexpattern}";
	 
	/**
	 * @return The groups the constraint belongs to.
	 */
		Class<?>[] groups() default { };

		/**
		 * @return The payload associated to the constraint
		 */
		Class<? extends Payload>[] payload() default {};
			
}
